<template>
	<view>
		<tm-quickIndex @change="itemClick" :list="list"></tm-quickIndex>
	</view>
</template>

<script>
	export default {
		onLoad(ref) {
			this.id=ref.id
		},
		data() {
			return {
				c_wh:0,
				id:'',
				place:'',
				place2:'',
								list: [
									{
										title: "历史热门",
										index:'热',
										children: [
											{title: " 杭州"},
											{title:  "上海"},
											{title:  "北京"},
											{title:  "武汉"},
											{title:  "南京"},
											{title:  "深圳"},
											{title:  "肇庆"},
											{title:  "临安"},
										]
									},
									{
										title: "A",
										children: [
											{title: " 阿克苏"},
											{title:  "鞍山"},
											{title:  "安阳"},
										]
									},
									{
										title: "B",
										index:"B",
										children: [
											{title: "宝鸡"},
											{title:  "北京"},
											{title:  "保定"},
										]
									},
									{
										title: "C",
										index:"C",
										children: [
											{title: "长沙"},
											{title:  "常熟"},
											{title:  "郴州"},
		
										]
									},
									{
										title: "D",
										index:"D",
										children: [
											{title: "大连"},
											{title:  "大理"},
											{title:  "大庆"},
	
										]
									},
									{
										title: "E",
										index:"E",
										children: [
											{title: " 峨眉山"},
											{title:  "鄂尔多斯"},
											{title:  "鄂州"},
										]
									},
								]
			}
		},
		methods: {
						itemClick(e){
							if(this.id == '1'){
								console.log(JSON.stringify(e))
								this.place =  e.data.title
								console.log(this.place)
								uni.$emit('getplace',this.place)
							}else{
								this.place2 = e.data.title
								uni.$emit('sendplace',this.place2)
							}

							uni.navigateBack({
								delta:0
							})
						}
		}
	}
</script>

<style>

</style>
